<?php
require_once('Zend/View/Helper/Abstract.php');

class Kbs_View_Helper_LinkPage extends Zend_View_Helper_Abstract
{
    public function linkPage($pageLinkUrl)
    {
        $businessObj = new Kbs_Model_Business_Page();
        $page = $businessObj->findByPageLinkUrl((string) $pageLinkUrl);

        $html = '';
        if ($page) {
            $page = $page[0];
            $pageDetail = $page->fetchDetailByLocale();
            $html = $this->view->link('/' . $pageLinkUrl . '.html', $pageDetail->getDetailLinkLabel());
        }
        return $html;
    }
}